package com.fdb.efp.console.api.rest;

import com.fdb.basic.framework.core.constant.ResponseData;
import com.fdb.basic.framework.web.controller.AbstractController;
import com.fdb.efp.console.service.facade.OrgWhiteListEService;
import com.fdb.efp.console.service.vo.OrgWhiteListEVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api")
public class OrgWhiteListEController extends AbstractController  {
	
	@Autowired
	@Qualifier("orgWhiteListEService")
	private OrgWhiteListEService orgWhiteListEService;

	
	/**
	 * 列表数据查询
	 * @param page
	 * @param size
	 * @return
	 */
//	@RequestMapping(value="/org/white/list/es", method=RequestMethod.POST)
//	public @ResponseBody ResponseData<List<OrgWhiteListEVO>> queryOrgWhiteListEAll(
//			@RequestBody OrgWhiteListEVO vo) {		
//		List<OrgWhiteListEVO> outputVo = this.executeQueryList("queryAll", orgWhiteListEService, new Object[]{vo});
//		return getResponseData(outputVo);
//		
//	}
	
	/**
	 * 根据主键查询详情
	 * @return
	 */
	@RequestMapping(value="/org/white/list/e/{orgCode}", method=RequestMethod.GET)
	public @ResponseBody ResponseData<OrgWhiteListEVO> queryByPk(@PathVariable("orgCode") String orgCode) {		
		OrgWhiteListEVO inVo = new OrgWhiteListEVO();
				inVo.setOrgCode(orgCode);
		OrgWhiteListEVO outputVo = orgWhiteListEService.queryByPk(inVo);
		return getResponseData(outputVo);
		
	}
	
	/**
	 * 根据主键删除信息
	 * @param orgWhiteListE
	 * @return
	 */
	@RequestMapping(value="/org/white/list/e", method=RequestMethod.DELETE)
	public @ResponseBody ResponseData<Integer> deleteByPk(@RequestBody OrgWhiteListEVO inOrgWhiteListEVo) {		
		int outputVo = orgWhiteListEService.deleteByPk(inOrgWhiteListEVo);
		return getResponseData(outputVo);
		
	}
	
	/**
	 * 根据主键更新信息
	 * @param inOrgWhiteListEVo
	 * @return
	 */
	@RequestMapping(value="/org/white/list/e", method=RequestMethod.PUT)
	public @ResponseBody ResponseData<Integer> updateByPk(@RequestBody OrgWhiteListEVO inOrgWhiteListEVo) {		
		int outputVo = orgWhiteListEService.updateByPk(inOrgWhiteListEVo);
		return getResponseData(outputVo);
		
	}
	
	/**
	 * 新增数据
	 * @param inOrgWhiteListEVo
	 * @return
	 */
	@RequestMapping(value="/org/white/list/e", method=RequestMethod.POST)
	public @ResponseBody ResponseData<Integer> insertOrgWhiteListE(@RequestBody OrgWhiteListEVO inOrgWhiteListEVo) {
		int outputVo = orgWhiteListEService.insertOrgWhiteListE(inOrgWhiteListEVo);
		return getResponseData(outputVo);
		
	}
}
